package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {

	// 查询所有未关联客户列表
	@GET
	@Path("/findNoAssociationCustomers")
	@Produces(value={"application/json","application/xml"})
	public List<Customer> findNoAssociationCustomers();

	// 已经关联到指定定区的客户列表
	@GET
	@Path("/findHasAssociationFixedAreaCustomers/{fixedAreaId}")
	@Consumes(value={"application/json","application/xml"})
	@Produces(value={"application/json","application/xml"})
	public List<Customer> findHasAssociationFixedAreaCustomers(@PathParam("fixedAreaId") String fixedAreaId);

	// 将客户关联到定区上 ， 将所有客户id 拼成字符串 1,2,3，使用@QueryParam实现
	@PUT
	@Path("/associationCustomersToFixedArea")
	@Consumes(value={"application/json","application/xml"})
	public void associationCustomersToFixedArea(@QueryParam("customerIdStr") String customerIdStr,@QueryParam("fixedAreaId") String fixedAreaId);
	@Path("/customer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void regist(Customer customer);
	//根据电话查询客户
	@GET
	@Path("/customer/telephone/{telephone}")
	@Consumes(value={"application/json","application/xml"})
	@Produces(value={"application/json","application/xml"})
	public Customer findByTelephone(@PathParam("telephone")String  telephone);
	//修改绑定状态
	@Path("/customer/updatetype/{telephone}")
	@PUT
	@Consumes({ "application/xml", "application/json" })
	public void updateType(@PathParam("telephone") String telephone);
}
